 //
//  ViewController.m
//  DevSpoof
//
//  Created by huang on 2018/11/5.
//  Copyright © 2018年 wdys. All rights reserved.
//

#import "ViewController.h"
#import <objc/runtime.h>
@interface CustomInfo: NSObject
@end

@implementation CustomInfo
- (NSString *)description{
    unsigned int count = 0;
    objc_property_t *props = class_copyPropertyList([self class], &count);
    NSMutableDictionary *keyValues = [NSMutableDictionary dictionary];
    for (int i = 0; i < count; i ++) {
        NSString *name = [NSString stringWithUTF8String:property_getName(props[i])];
        id value = [self valueForKey:name];
        NSLog(@"%@ %@",name,value);
        keyValues[name] = value;
    }
    return [keyValues description];
}
@end

@interface SystemInfo: NSObject
@property (nonatomic, copy)NSString *uuid;
@property (nonatomic, copy)NSString *systemId;
@property (nonatomic, strong)CustomInfo *info;
@end
@implementation SystemInfo

@end


@interface ViewController()
@property (weak) IBOutlet NSTextField *cSmUUIDLB;
@property (weak) IBOutlet NSTextField *cUUIDLB;
@property (weak) IBOutlet NSTextField *cEthernetMACLB;
@property (weak) IBOutlet NSTextField *cWifiMACLB;
@property (weak) IBOutlet NSTextField *cCSRLB;
@property (weak) IBOutlet NSTextField *cSerialNumLB;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
//    [self changeSmUUID];
//    CustomInfo *info = [CustomInfo generateFromSystem];
//    info = [CustomInfo generateNew];
//    NSLog(@"%@",info);
    
//    dispatch_async(dispatch_get_global_queue(0, 0), ^{
//        [self addScriptsExecPermissions];
//        [self generateNewCSR];
//        [self changeSmUUID];
//        [self changeMacAdress];
//        dispatch_async(dispatch_get_main_queue(), ^{
//            NSString *current_uuid = getUUID();
//            self.cUUIDLB.stringValue = current_uuid;
//
//            NSString *current_serialnum = getHardwareSerialNumber();
//            self.cSerialNumLB.stringValue = current_serialnum;
//        });
//    });
}

- (void)setRepresentedObject:(id)representedObject {
    [super setRepresentedObject:representedObject];

    // Update the view, if already loaded.
}


@end
